<!DOCTYPE html>
<html><head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    
    <link rel="canonical" href="/unity-creator-kit-fps/record/">

    <title>
        
        record | h-book
        
    </title>

    
    <link href="/css/fontawesome.min.css" rel="stylesheet">

    
    <link rel="stylesheet" href="/css/ace.min.css">

    

    

</head>
<body><nav class="navbar navbar-expand-lg navbar-dark bg-primary shadow sticky-top" id="navbarMain">
    <div class="container">
        <div>
            <a class="navbar-brand" href="/">
                
                h-book
            </a>
        </div>
    </div>
</nav>
<div class="container-fluid">
            <div class="row">

                <div class="docs-sidenav order-0 col-12 col-md-3 col-lg-2 col-xl-2 position-sticky border-right"><nav class="navbar navbar-expand-md navbar-light pl-0">
    <button class="navbar-toggler navbar-toggler-right collapsed" type="button" data-toggle="collapse" data-target="#sidenav-left-collapse" aria-controls="sidenav-left-collapse" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>

     <div class="collapse navbar-collapse align-items-start flex-column" id="sidenav-left-collapse">
            <form class="form-inline my-2 my-lg-0 searchbox">
                <input class="form-control mr-sm-2 w-100" data-search-input id="search-by" type="text" placeholder="Search">
            </form>

        

         <ul class="navbar-nav flex-column pt-3">
    <li data-nav-id="/hugo/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/hugo/"><h6>Hugo</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/hugo/init/" class="nav-item my-1">
                
                
                  <a href="/hugo/init/" class="nav-link p-0">
                    init
                  </a>
                
        </li>
        <li data-nav-id="/hugo/add-page/" class="nav-item my-1">
                
                
                  <a href="/hugo/add-page/" class="nav-link p-0">
                    add-page
                  </a>
                
        </li>
        <li data-nav-id="/hugo/edit-skill/" class="nav-item my-1">
                
                
                  <a href="/hugo/edit-skill/" class="nav-link p-0">
                    edit-skill
                  </a>
                
        </li>
        <li data-nav-id="/hugo/publish/" class="nav-item my-1">
                
                
                  <a href="/hugo/publish/" class="nav-link p-0">
                    publish
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/android/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/android/"><h6>Android</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/android/install/" class="nav-item my-1">
                
                
                  <a href="/android/install/" class="nav-link p-0">
                    install
                  </a>
                
        </li>
        <li data-nav-id="/android/create-project/" class="nav-item my-1">
                
                
                  <a href="/android/create-project/" class="nav-link p-0">
                    create project
                  </a>
                
        </li>
        <li data-nav-id="/android/import-material/" class="nav-item my-1">
                
                
                  <a href="/android/import-material/" class="nav-link p-0">
                    import material
                  </a>
                
        </li>
        <li data-nav-id="/android/start-page/" class="nav-item my-1">
                
                
                  <a href="/android/start-page/" class="nav-link p-0">
                    startpage
                  </a>
                
        </li>
        <li data-nav-id="/android/i18n/" class="nav-item my-1">
                
                
                  <a href="/android/i18n/" class="nav-link p-0">
                    i18n
                  </a>
                
        </li>
        <li data-nav-id="/android/nav-flat-page/" class="nav-item my-1">
                
                
                  <a href="/android/nav-flat-page/" class="nav-link p-0">
                    nav flat page
                  </a>
                
        </li>
        <li data-nav-id="/android/activity/" class="nav-item my-1">
                
                
                  <a href="/android/activity/" class="nav-link p-0">
                    Activity
                  </a>
                
        </li>
        <li data-nav-id="/android/db/" class="nav-item my-1">
                
                
                  <a href="/android/db/" class="nav-link p-0">
                    DB
                  </a>
                
        </li>
        <li data-nav-id="/android/dialog/" class="nav-item my-1">
                
                
                  <a href="/android/dialog/" class="nav-link p-0">
                    Dialog
                  </a>
                
        </li>
        <li data-nav-id="/android/fragment/" class="nav-item my-1">
                
                
                  <a href="/android/fragment/" class="nav-link p-0">
                    Fragment
                  </a>
                
        </li>
        <li data-nav-id="/android/jetpack/" class="nav-item my-1">
                
                
                  <a href="/android/jetpack/" class="nav-link p-0">
                    Jetpack
                  </a>
                
        </li>
        <li data-nav-id="/android/material/" class="nav-item my-1">
                
                
                  <a href="/android/material/" class="nav-link p-0">
                    Material
                  </a>
                
        </li>
        <li data-nav-id="/android/storage/" class="nav-item my-1">
                
                
                  <a href="/android/storage/" class="nav-link p-0">
                    Storage
                  </a>
                
        </li>
        <li data-nav-id="/android/%E5%9B%BE%E6%A0%87/" class="nav-item my-1">
                
                
                  <a href="/android/%E5%9B%BE%E6%A0%87/" class="nav-link p-0">
                    图标
                  </a>
                
        </li>
        <li data-nav-id="/android/store/" class="nav-item my-1">
                
                
                  <a href="/android/store/" class="nav-link p-0">
                    Store
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/blender/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/blender/"><h6>Blender</h6></a>
        
    </li>
    <li data-nav-id="/bootstrap/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/bootstrap/"><h6>BootStrap</h6></a>
        
    </li>
    <li data-nav-id="/centos7/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/centos7/"><h6>Centos7</h6></a>
        
    </li>
    <li data-nav-id="/dlna/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/dlna/"><h6>DLNA</h6></a>
        
    </li>
    <li data-nav-id="/docker/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/docker/"><h6>Docker</h6></a>
        
    </li>
    <li data-nav-id="/dubbo/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/dubbo/"><h6>Dubbo</h6></a>
        
    </li>
    <li data-nav-id="/ffmpeg/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/ffmpeg/"><h6>FFmpeg</h6></a>
        
    </li>
    <li data-nav-id="/git/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/git/"><h6>Git</h6></a>
        
    </li>
    <li data-nav-id="/gitbook/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/gitbook/"><h6>Gitbook</h6></a>
        
    </li>
    <li data-nav-id="/gitlab/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/gitlab/"><h6>Gitlab</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/gitlab/runner/" class="nav-item my-1">
                
                
                  <a href="/gitlab/runner/" class="nav-link p-0">
                    Runner
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/gradle/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/gradle/"><h6>Gradle</h6></a>
        
    </li>
    <li data-nav-id="/java/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/java/"><h6>Java</h6></a>
        
    </li>
    <li data-nav-id="/jenkins/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/jenkins/"><h6>Jenkins</h6></a>
        
    </li>
    <li data-nav-id="/kubernetes/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/kubernetes/"><h6>Kubernetes</h6></a>
        
    </li>
    <li data-nav-id="/mybatis/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/mybatis/"><h6>Mybatis</h6></a>
        
    </li>
    <li data-nav-id="/mybatis-plus/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/mybatis-plus/"><h6>Mybatis Plus</h6></a>
        
    </li>
    <li data-nav-id="/mysql/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/mysql/"><h6>MySQL</h6></a>
        
    </li>
    <li data-nav-id="/nodejs/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/nodejs/"><h6>Node.js</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/nodejs/npm/" class="nav-item my-1">
                
                
                  <a href="/nodejs/npm/" class="nav-link p-0">
                    NPM
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/postgresql/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/postgresql/"><h6>PostgreSQL</h6></a>
        
    </li>
    <li data-nav-id="/redis/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/redis/"><h6>Redis</h6></a>
        
    </li>
    <li data-nav-id="/samba/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/samba/"><h6>Samba</h6></a>
        
    </li>
    <li data-nav-id="/sql/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/sql/"><h6>SQL</h6></a>
        
    </li>
    <li data-nav-id="/ue5/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/ue5/"><h6>UE5</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/ue5/install/" class="nav-item my-1">
                
                
                  <a href="/ue5/install/" class="nav-link p-0">
                    install
                  </a>
                
        </li>
        <li data-nav-id="/ue5/uninstall/" class="nav-item my-1">
                
                
                  <a href="/ue5/uninstall/" class="nav-link p-0">
                    uninstall
                  </a>
                
        </li>
        <li data-nav-id="/ue5/qa/" class="nav-item my-1">
                
                
                  <a href="/ue5/qa/" class="nav-link p-0">
                    Q&amp;A
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity/"><h6>Unity</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity/install/" class="nav-item my-1">
                
                
                  <a href="/unity/install/" class="nav-link p-0">
                    install
                  </a>
                
        </li>
        <li data-nav-id="/unity/scene/" class="nav-item my-1">
                
                
                  <a href="/unity/scene/" class="nav-link p-0">
                    scene
                  </a>
                
        </li>
        <li data-nav-id="/unity/inspector/" class="nav-item my-1">
                
                
                  <a href="/unity/inspector/" class="nav-link p-0">
                    inspector
                  </a>
                
        </li>
        <li data-nav-id="/unity/assets/" class="nav-item my-1">
                
                
                  <a href="/unity/assets/" class="nav-link p-0">
                    assets
                  </a>
                
        </li>
        <li data-nav-id="/unity/audio-source/" class="nav-item my-1">
                
                
                  <a href="/unity/audio-source/" class="nav-link p-0">
                    audio source
                  </a>
                
        </li>
        <li data-nav-id="/unity/camera/" class="nav-item my-1">
                
                
                  <a href="/unity/camera/" class="nav-link p-0">
                    camera
                  </a>
                
        </li>
        <li data-nav-id="/unity/script/" class="nav-item my-1">
                
                
                  <a href="/unity/script/" class="nav-link p-0">
                    script
                  </a>
                
        </li>
        <li data-nav-id="/unity/prefabs/" class="nav-item my-1">
                
                
                  <a href="/unity/prefabs/" class="nav-link p-0">
                    prefabs
                  </a>
                
        </li>
        <li data-nav-id="/unity/physics/" class="nav-item my-1">
                
                
                  <a href="/unity/physics/" class="nav-link p-0">
                    physics
                  </a>
                
        </li>
        <li data-nav-id="/unity/skybox/" class="nav-item my-1">
                
                
                  <a href="/unity/skybox/" class="nav-link p-0">
                    skybox
                  </a>
                
        </li>
        <li data-nav-id="/unity/particle-system/" class="nav-item my-1">
                
                
                  <a href="/unity/particle-system/" class="nav-link p-0">
                    particle system
                  </a>
                
        </li>
        <li data-nav-id="/unity/shortcut-keys/" class="nav-item my-1">
                
                
                  <a href="/unity/shortcut-keys/" class="nav-link p-0">
                    shortcut keys
                  </a>
                
        </li>
        <li data-nav-id="/unity/qa/" class="nav-item my-1">
                
                
                  <a href="/unity/qa/" class="nav-link p-0">
                    Q&amp;A
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-2d-beginner/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-2d-beginner/"><h6>Unity 2D Beginner</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-2d-beginner/init-and-move/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/init-and-move/" class="nav-link p-0">
                    Init &amp; Move
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/map/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/map/" class="nav-link p-0">
                    Map
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/data/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/data/" class="nav-link p-0">
                    Data
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/animate/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/animate/" class="nav-link p-0">
                    Data
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/bullet/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/bullet/" class="nav-link p-0">
                    Bullet
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/cinemachine/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/cinemachine/" class="nav-link p-0">
                    Cinemachine
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/particle/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/particle/" class="nav-link p-0">
                    Particle
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/ui/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/ui/" class="nav-link p-0">
                    UI
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/npc/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/npc/" class="nav-link p-0">
                    NPC
                  </a>
                
        </li>
        <li data-nav-id="/unity-2d-beginner/sound/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-beginner/sound/" class="nav-link p-0">
                    Sound
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-2d-game-kit/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-2d-game-kit/"><h6>Unity 2D Game Kit</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-2d-game-kit/record/" class="nav-item my-1">
                
                
                  <a href="/unity-2d-game-kit/record/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-3d-beginner/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-3d-beginner/"><h6>Unity 3D Beginner</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-3d-beginner/init/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/level/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/level/" class="nav-link p-0">
                    Level
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/nav/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/nav/" class="nav-link p-0">
                    Nav
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/render-pipeline/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/render-pipeline/" class="nav-link p-0">
                    Render Pipeline
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/postprocessing/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/postprocessing/" class="nav-link p-0">
                    PostProcessing
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/ui/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/ui/" class="nav-link p-0">
                    UI
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/enemy/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/enemy/" class="nav-link p-0">
                    Enemy
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/sound/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/sound/" class="nav-link p-0">
                    Sound
                  </a>
                
        </li>
        <li data-nav-id="/unity-3d-beginner/%E5%BB%BA%E6%A8%A1%E5%B7%A5%E5%85%B7/" class="nav-item my-1">
                
                
                  <a href="/unity-3d-beginner/%E5%BB%BA%E6%A8%A1%E5%B7%A5%E5%85%B7/" class="nav-link p-0">
                    建模工具
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-arpg/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-arpg/"><h6>Unity ARPG</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-arpg/init/" class="nav-item my-1">
                
                
                  <a href="/unity-arpg/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        <li data-nav-id="/unity-arpg/role-state-machine/" class="nav-item my-1">
                
                
                  <a href="/unity-arpg/role-state-machine/" class="nav-link p-0">
                    Role State Machine
                  </a>
                
        </li>
        <li data-nav-id="/unity-arpg/api-piece/" class="nav-item my-1">
                
                
                  <a href="/unity-arpg/api-piece/" class="nav-link p-0">
                    API Piece
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-creativecore-animation/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-creativecore-animation/"><h6>Unity Creativecore Animation</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-creativecore-animation/door/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-animation/door/" class="nav-link p-0">
                    Door
                  </a>
                
        </li>
        <li data-nav-id="/unity-creativecore-animation/init/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-animation/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-creativecore-lighting/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-creativecore-lighting/"><h6>Unity Creativecore Lighting</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-creativecore-lighting/init/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-lighting/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        <li data-nav-id="/unity-creativecore-lighting/outdoor/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-lighting/outdoor/" class="nav-link p-0">
                    Outdoor
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-creativecore-shader/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-creativecore-shader/"><h6>Unity Creativecore Shader</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-creativecore-shader/init/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-shader/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        <li data-nav-id="/unity-creativecore-shader/glass/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-shader/glass/" class="nav-link p-0">
                    Glass
                  </a>
                
        </li>
        <li data-nav-id="/unity-creativecore-shader/shader-graph/" class="nav-item my-1">
                
                
                  <a href="/unity-creativecore-shader/shader-graph/" class="nav-link p-0">
                    Shader-Graph
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-creator-kit-beginner-code/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-creator-kit-beginner-code/"><h6>Unity Creator Kit Beginner Code</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-creator-kit-beginner-code/record/" class="nav-item my-1">
                
                
                  <a href="/unity-creator-kit-beginner-code/record/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-creator-kit-fps/" class="nav-item my-1 parent haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-creator-kit-fps/"><h6>Unity Creator Kit FPS</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-creator-kit-fps/record/" class="nav-item my-1 active">
                
                
                  <a href="/unity-creator-kit-fps/record/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-mythirdperson/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-mythirdperson/"><h6>Unity My Third Person</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-mythirdperson/init/" class="nav-item my-1">
                
                
                  <a href="/unity-mythirdperson/init/" class="nav-link p-0">
                    Init
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-playground/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-playground/"><h6>Unity Playground</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-playground/record/" class="nav-item my-1">
                
                
                  <a href="/unity-playground/record/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-ui/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-ui/"><h6>Unity UI</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-ui/init/" class="nav-item my-1">
                
                
                  <a href="/unity-ui/init/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/unity-vfx/" class="nav-item my-1 haschildren
        ">
        
        
          <a class="nav-link p-0" href="/unity-vfx/"><h6>Unity VFX</h6></a>
        
        <ul class="list-unstyled ml-2">
        <li data-nav-id="/unity-vfx/init/" class="nav-item my-1">
                
                
                  <a href="/unity-vfx/init/" class="nav-link p-0">
                    record
                  </a>
                
        </li>
        <li data-nav-id="/unity-vfx/bullet/" class="nav-item my-1">
                
                
                  <a href="/unity-vfx/bullet/" class="nav-link p-0">
                    bullet
                  </a>
                
        </li>
        <li data-nav-id="/unity-vfx/rain/" class="nav-item my-1">
                
                
                  <a href="/unity-vfx/rain/" class="nav-link p-0">
                    rain
                  </a>
                
        </li>
        <li data-nav-id="/unity-vfx/rock-rain/" class="nav-item my-1">
                
                
                  <a href="/unity-vfx/rock-rain/" class="nav-link p-0">
                    Rock Rain
                  </a>
                
        </li>
        </ul>
    </li>
    <li data-nav-id="/vue/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/vue/"><h6>Vue</h6></a>
        
    </li>
    <li data-nav-id="/web/" class="nav-item my-1
        ">
        
        
          <a class="nav-link p-0" href="/web/"><h6>Web</h6></a>
        
    </li>
        </ul>
    </div>
</nav>


</div>
                <div class="docs-toc large order-lg-2 order-md-0 order-xs-1 col-12 col-lg-2 col-xl-2 position-sticky border-left"><div class="docs-toc">
	<nav id="TableOfContents">
  <ul>
    <li><a href="#导入">导入</a></li>
    <li><a href="#targets">Targets</a>
      <ul>
        <li><a href="#target-脚本代码解析">Target 脚本代码解析</a></li>
      </ul>
    </li>
    <li><a href="#编辑地图">编辑地图</a></li>
    <li><a href="#编辑武器">编辑武器</a></li>
    <li><a href="#编辑终点">编辑终点</a>
      <ul>
        <li><a href="#endcheckpoint-脚本代码解析">EndCheckpoint 脚本代码解析</a></li>
      </ul>
    </li>
    <li><a href="#编译打包">编译打包</a></li>
  </ul>
</nav>
</div>
</div>
                <div class="main col-12 order-1 col-md-9 col-lg-10 col-xl-8 py-3">
                

<div class="d-flex flex-column">
    <h1 class="js-title">record</h1>
    <div class="d-flex align-items-center">
        
    </div>
</div>

<hr>


<p>2024.08.18</p>
<h2 id="导入">导入</h2>
<ol>
<li>使用 2022.3.40f1</li>
<li>新建 3D 工程</li>
<li>将工程拖拽到 Assets</li>
<li>允许导入和升级依赖模块</li>
</ol>
<p>得如下结构</p>
<div class="highlight"><pre tabindex="0" style="color:#272822;background-color:#fafafa;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-txt" data-lang="txt"><span style="display:flex;"><span>- Asssets
</span></span><span style="display:flex;"><span>  - Creator Kit - FPS
</span></span><span style="display:flex;"><span>  - Resources
</span></span><span style="display:flex;"><span>  - Scenes
</span></span><span style="display:flex;"><span>  - TutorialInfo
</span></span></code></pre></div><ol start="5">
<li>通过新增的 FPSKIT 菜单，选择 Create new Scene， 在 Assets/Scenes 中创建一个 MyScene.unity</li>
</ol>
<h2 id="targets">Targets</h2>
<ol>
<li>创建一个 Creator Kit - FPS/Prefabs/Targets/BloodCellTarget</li>
<li>在 Inspector 中查看设置项</li>
</ol>
<ul>
<li>Rigidbody
<ul>
<li>Use Gravity 没勾</li>
</ul>
</li>
<li>Target Script
<ul>
<li>Health 3 生命值</li>
<li>Point Value -5 击杀后的奖励值</li>
<li>Destroyed Effect 死亡后特效</li>
<li>Hit Play 被打音效</li>
<li>Idle Source 空闲音效</li>
</ul>
</li>
<li>Capsule Collider
<ul>
<li>Is Trigger 没勾</li>
</ul>
</li>
</ul>
<ol start="3">
<li>创建一个 Creator Kit - FPS/Prefabs/Targets/GermSlimeTarget</li>
<li>在 Inspector 中查看设置项</li>
</ol>
<ul>
<li>Rigidbody 同上</li>
<li>Target Script
<ul>
<li>Health 3 生命值</li>
<li>Point Value 5 击杀后的奖励值</li>
<li>Destroyed Effect 死亡后特效</li>
<li>Hit Play 被打音效</li>
<li>Idle Source 空闲音效</li>
</ul>
</li>
<li>Capsule Collider
<ul>
<li>Is Trigger 没勾</li>
</ul>
</li>
</ul>
<ol start="5">
<li>创建一个空对象，取名叫 Targets ，将上面的对象都拖拽到里面，此时 Targets 的 Transform Position 的值为包裹所有子对象的的中心，而子对象的 Position 是相对这个中心的位置</li>
<li>用 Assets/Creator Kit - FPS/Art/Models/Characters/GermSpike 创建一个物体。虽然这也是个预制体，但是没完全做完，比如不能与子弹碰撞</li>
<li>给创建的 GermSpike 添加 Rigidbody 组件，取消 Use Gravity 勾选，再勾选 Is Kinematic （会阻止子弹或其它物体碰撞后移动，即只能用自身的 Transform 移动，不受物理引擎驱动）</li>
<li>再给创建的 GermSpike 添加 Sphere Collider ，调整 Center 和 Radius 的值使碰撞检测球包裹整个模型（配合 Iso 模式下的三轴视角匹配）。另外可以将这个物体自带的 HitPlayer（却音频） 和 IdlePlayer 拖拽到 Target Script 中的 Hit Play 和 Idle Source 中</li>
<li>最后将这个物体拖拽到 Prefabs 中作为一个新的预制体，后续就可以用这个预制体来制作同类目标了</li>
</ol>
<h3 id="target-脚本代码解析">Target 脚本代码解析</h3>
<div class="highlight"><pre tabindex="0" style="color:#272822;background-color:#fafafa;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cs" data-lang="cs"><span style="display:flex;"><span><span style="color:#75715e">// 生命值</span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">public</span> <span style="color:#00a8c8">float</span> <span style="color:#111">health</span> <span style="color:#111">=</span> <span style="color:#ae81ff">5.0f</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 分数</span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">public</span> <span style="color:#00a8c8">int</span> <span style="color:#111">pointValue</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 死亡特效。 ParticleSystem 是 Unity 的组件</span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">public</span> <span style="color:#111">ParticleSystem</span> <span style="color:#111">DestroyedEffect</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 被打音效，丰富随机性</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">/*
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">[RequireComponent(typeof(AudioSource))]
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">public class RandomPlayer : MonoBehaviour
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">{
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    public AudioClip[] Clips;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    public float PitchMin = 1.0f;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    public float PitchMax = 1.0f;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    // TODO 委托的语法糖？！
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    public AudioSource source =&gt; m_Source;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    AudioSource m_Source;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    // 初始化，不管组件是否启用，都会调用一次
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    void Awake()
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">        m_Source = GetComponent&lt;AudioSource&gt;();
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    // Target.cs 调用
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    public AudioClip GetRandomClip()
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">        return Clips[Random.Range(0, Clips.Length)]; // 随机取一个音频
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    // Target.cs 调用
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    public void PlayRandom()
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">        if(Clips.Length == 0)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">            return;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">        
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">        PlayClip(GetRandomClip(), PitchMin, PitchMax);
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    // Controller.cs 调用
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    public void PlayClip(AudioClip clip, float pitchMin, float pitchMax)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">        m_Source.pitch = Random.Range(pitchMin, pitchMax); // 随机调整音调
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">        m_Source.PlayOneShot(clip); // 播放音频
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">}
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">*/</span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">public</span> <span style="color:#111">RandomPlayer</span> <span style="color:#111">HitPlayer</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// 空闲音效</span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">public</span> <span style="color:#111">AudioSource</span> <span style="color:#111">IdleSource</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">void</span> <span style="color:#111">Awake</span><span style="color:#111">()</span>
</span></span><span style="display:flex;"><span><span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>  <span style="color:#75715e">/*
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">  public class Helpers
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">  {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      public static void RecursiveLayerChange(Transform parent, int layer)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          parent.gameObject.layer = layer;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          foreach(Transform t in parent)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              RecursiveLayerChange(t, layer);
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">  }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">  */</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">Helpers</span><span style="color:#111">.</span><span style="color:#111">RecursiveLayerChange</span><span style="color:#111">(</span><span style="color:#111">transform</span><span style="color:#111">,</span> <span style="color:#111">LayerMask</span><span style="color:#111">.</span><span style="color:#111">NameToLayer</span><span style="color:#111">(</span><span style="color:#d88200">&#34;Target&#34;</span><span style="color:#111">));</span> <span style="color:#75715e">// 设置所有子物体的 Layer 为 Target</span>
</span></span><span style="display:flex;"><span><span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">void</span> <span style="color:#111">Start</span><span style="color:#111">()</span>
</span></span><span style="display:flex;"><span><span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">if</span><span style="color:#111">(</span><span style="color:#111">DestroyedEffect</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">/*
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    public class PoolSystem : MonoBehaviour {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      public static PoolSystem Instance { get; private set; } // 单例
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      public static void Create() // GameSystem.cs 在 Awake 时调用 PoolSystem.Create();
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          GameObject obj = new GameObject(&#34;PoolSystem&#34;);
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          Instance = obj.AddComponent&lt;PoolSystem&gt;();
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      Dictionary&lt;Object, Queue&lt;Object&gt;&gt; m_Pools = new Dictionary&lt;Object, Queue&lt;Object&gt;&gt;(); // Map
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      public void InitPool(UnityEngine.Object prefab, int size)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          if(m_Pools.ContainsKey(prefab))
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              return;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          Queue&lt;Object&gt; queue = new Queue&lt;Object&gt;();
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          for (int i = 0; i &lt; size; ++i) // 循环创建多个预制体并设定 Active 为 false ，加入到队列中
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              var o = Instantiate(prefab);
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              SetActive(o, false);
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              queue.Enqueue(o);
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          m_Pools[prefab] = queue;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      public T GetInstance&lt;T&gt;(Object prefab) where T:Object
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          Queue&lt;Object&gt; queue;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          if (m_Pools.TryGetValue(prefab, out queue))
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              Object obj;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              if (queue.Count &gt; 0) {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">                  obj = queue.Dequeue();  // 出队
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              } else {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">                  obj = Instantiate(prefab);
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              SetActive(obj, true);
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              queue.Enqueue(obj); // 入队。做一个循环利用
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              return obj as T;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          UnityEngine.Debug.LogError(&#34;No pool was init with this prefab&#34;);
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          return null;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      static void SetActive(Object obj, bool active)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          GameObject go = null;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          if (obj is Component component) {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              go = component.gameObject;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          } else {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              go = obj as GameObject;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          go.SetActive(active);
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">      }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">     */</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">PoolSystem</span><span style="color:#111">.</span><span style="color:#111">Instance</span><span style="color:#111">.</span><span style="color:#111">InitPool</span><span style="color:#111">(</span><span style="color:#111">DestroyedEffect</span><span style="color:#111">,</span> <span style="color:#ae81ff">16</span><span style="color:#111">);</span>
</span></span><span style="display:flex;"><span>    
</span></span><span style="display:flex;"><span>    <span style="color:#111">m_CurrentHealth</span> <span style="color:#111">=</span> <span style="color:#111">health</span><span style="color:#111">;</span> <span style="color:#75715e">// 设定血量为当前血量</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">if</span><span style="color:#111">(</span><span style="color:#111">IdleSource</span> <span style="color:#111">!=</span> <span style="color:#00a8c8">null</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">IdleSource</span><span style="color:#111">.</span><span style="color:#111">time</span> <span style="color:#111">=</span> <span style="color:#111">Random</span><span style="color:#111">.</span><span style="color:#111">Range</span><span style="color:#111">(</span><span style="color:#ae81ff">0.0f</span><span style="color:#111">,</span> <span style="color:#111">IdleSource</span><span style="color:#111">.</span><span style="color:#111">clip</span><span style="color:#111">.</span><span style="color:#111">length</span><span style="color:#111">);</span> <span style="color:#75715e">// 随机播放位置</span>
</span></span><span style="display:flex;"><span><span style="color:#111">}</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Weapon.cs 调用</span>
</span></span><span style="display:flex;"><span><span style="color:#00a8c8">public</span> <span style="color:#00a8c8">void</span> <span style="color:#111">Got</span><span style="color:#111">(</span><span style="color:#00a8c8">float</span> <span style="color:#111">damage</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span><span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">m_CurrentHealth</span> <span style="color:#111">-=</span> <span style="color:#111">damage</span><span style="color:#111">;</span> <span style="color:#75715e">// 减少血量</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">if</span><span style="color:#111">(</span><span style="color:#111">HitPlayer</span> <span style="color:#111">!=</span> <span style="color:#00a8c8">null</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">HitPlayer</span><span style="color:#111">.</span><span style="color:#111">PlayRandom</span><span style="color:#111">();</span> <span style="color:#75715e">// 播放被打音效</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">if</span><span style="color:#111">(</span><span style="color:#111">m_CurrentHealth</span> <span style="color:#111">&gt;</span> <span style="color:#ae81ff">0</span><span style="color:#111">)</span> <span style="color:#75715e">// 还有血就结束逻辑</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">return</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 血 &lt;= 0 </span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">Vector3</span> <span style="color:#111">position</span> <span style="color:#111">=</span> <span style="color:#111">transform</span><span style="color:#111">.</span><span style="color:#111">position</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 存在被打音效</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">if</span> <span style="color:#111">(</span><span style="color:#111">HitPlayer</span> <span style="color:#111">!=</span> <span style="color:#00a8c8">null</span><span style="color:#111">)</span> 
</span></span><span style="display:flex;"><span>    <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">var</span> <span style="color:#111">source</span> <span style="color:#111">=</span> <span style="color:#111">WorldAudioPool</span><span style="color:#111">.</span><span style="color:#111">GetWorldSFXSource</span><span style="color:#111">();</span> <span style="color:#75715e">// 调用的逻辑是 PoolSystem.Instance.GetInstance&lt;AudioSource&gt;(s_Instance.WorldSFXSourcePrefab); 返回的是 AudioSource</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">source</span><span style="color:#111">.</span><span style="color:#111">transform</span><span style="color:#111">.</span><span style="color:#111">position</span> <span style="color:#111">=</span> <span style="color:#111">position</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">source</span><span style="color:#111">.</span><span style="color:#111">pitch</span> <span style="color:#111">=</span> <span style="color:#111">HitPlayer</span><span style="color:#111">.</span><span style="color:#111">source</span><span style="color:#111">.</span><span style="color:#111">pitch</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">source</span><span style="color:#111">.</span><span style="color:#111">PlayOneShot</span><span style="color:#111">(</span><span style="color:#111">HitPlayer</span><span style="color:#111">.</span><span style="color:#111">GetRandomClip</span><span style="color:#111">());</span> <span style="color:#75715e">// 播放。 TODO 不懂为什么用 WorldAudioPool 播放音频</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 存在销毁特效</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">if</span> <span style="color:#111">(</span><span style="color:#111">DestroyedEffect</span> <span style="color:#111">!=</span> <span style="color:#00a8c8">null</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">var</span> <span style="color:#111">effect</span> <span style="color:#111">=</span> <span style="color:#111">PoolSystem</span><span style="color:#111">.</span><span style="color:#111">Instance</span><span style="color:#111">.</span><span style="color:#111">GetInstance</span><span style="color:#111">&lt;</span><span style="color:#111">ParticleSystem</span><span style="color:#111">&gt;(</span><span style="color:#111">DestroyedEffect</span><span style="color:#111">);</span> <span style="color:#75715e">// 获取一个粒子特效</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">effect</span><span style="color:#111">.</span><span style="color:#111">time</span> <span style="color:#111">=</span> <span style="color:#ae81ff">0.0f</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">effect</span><span style="color:#111">.</span><span style="color:#111">Play</span><span style="color:#111">();</span> <span style="color:#75715e">// 播放</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">effect</span><span style="color:#111">.</span><span style="color:#111">transform</span><span style="color:#111">.</span><span style="color:#111">position</span> <span style="color:#111">=</span> <span style="color:#111">position</span><span style="color:#111">;</span> <span style="color:#75715e">// 设定位置为当前物体位置</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">m_Destroyed</span> <span style="color:#111">=</span> <span style="color:#00a8c8">true</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">gameObject</span><span style="color:#111">.</span><span style="color:#111">SetActive</span><span style="color:#111">(</span><span style="color:#00a8c8">false</span><span style="color:#111">);</span> <span style="color:#75715e">// 物体消失</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">/*
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    public void TargetDestroyed(int score)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">        m_TargetDestroyed += 1;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">        m_Score += score;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">        GameSystemInfo.Instance.UpdateScore(m_Score);
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">    }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">     */</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">GameSystem</span><span style="color:#111">.</span><span style="color:#111">Instance</span><span style="color:#111">.</span><span style="color:#111">TargetDestroyed</span><span style="color:#111">(</span><span style="color:#111">pointValue</span><span style="color:#111">);</span> <span style="color:#75715e">// 加分</span>
</span></span><span style="display:flex;"><span><span style="color:#111">}</span>
</span></span></code></pre></div><h2 id="编辑地图">编辑地图</h2>
<ol>
<li>点击 Hierarchy/LevelLayout ，在 Inspector 中的 Level Layout 组件点击 Editing Layout ，然后点击 CorridorGroup ，选择一个通道，再在 Scene 中确定位置。同理选择 RoomGroup 中的一个，可以新增一个房间。完成编辑后可以再点击 Editing Layout 取消编辑状态</li>
<li>从 Assets/Creator Kit - FPS/Prefabs/Door and Key 中创建一个 FatBLob （门）和 Key （钥匙）。在 Key 的 Key 脚本中设置 Key Type 的值，再在 FatBLob 的 Lock 脚本设置相同值的 Key Type</li>
</ol>
<h2 id="编辑武器">编辑武器</h2>
<ol>
<li>在 Assets/Creator Kit - FPS/Prefabs/Weapons 中赋值一个预制体并改名，然后在 Inspector 中修改参数</li>
<li>选择 Hierarchy/Character ，在 Inspector 中的 Controller 脚本参数找到 Starting Weapons ，添加一个并设置刚刚修改的武器，即可添加武器</li>
</ol>
<h2 id="编辑终点">编辑终点</h2>
<ol>
<li>在 Hierarchy 中添加一个空对象，可以改名为 LayoutEnd</li>
<li>将 LayoutEnd 放置于地图的终点，并添加 Box Collider 组件，给 Box Collider 的 Is Trigger 勾选，不然发生物理碰撞会进不去。再添加一个 End Checkpoint 脚本</li>
</ol>
<h3 id="endcheckpoint-脚本代码解析">EndCheckpoint 脚本代码解析</h3>
<div class="highlight"><pre tabindex="0" style="color:#272822;background-color:#fafafa;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-cs" data-lang="cs"><span style="display:flex;"><span><span style="color:#00a8c8">public</span> <span style="color:#00a8c8">class</span> <span style="color:#75af00">EndCheckpoint</span> <span style="color:#111">:</span> <span style="color:#111">MonoBehaviour</span>
</span></span><span style="display:flex;"><span><span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>    <span style="color:#00a8c8">void</span> <span style="color:#111">OnTriggerEnter</span><span style="color:#111">(</span><span style="color:#111">Collider</span> <span style="color:#111">other</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">{</span>
</span></span><span style="display:flex;"><span>        <span style="color:#00a8c8">if</span> <span style="color:#111">(</span><span style="color:#111">other</span><span style="color:#111">.</span><span style="color:#111">GetComponent</span><span style="color:#111">&lt;</span><span style="color:#111">Controller</span><span style="color:#111">&gt;()</span> <span style="color:#111">==</span> <span style="color:#00a8c8">null</span><span style="color:#111">)</span>
</span></span><span style="display:flex;"><span>            <span style="color:#00a8c8">return</span><span style="color:#111">;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">/*
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          void Update()
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              if (m_TimerRunning) {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">                  m_Timer += Time.deltaTime; // 游戏进行中的计时器
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">                  GameSystemInfo.Instance.UpdateTimer(m_Timer);
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              Transform playerTransform = Controller.Instance.transform; // Controller 玩家的脚本
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              MinimapUI.Instance.UpdateForPlayerTransform(playerTransform); // 更新小地图玩家位置
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              if(FullscreenMap.Instance.gameObject.activeSelf)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">                  FullscreenMap.Instance.UpdateForPlayerTransform(playerTransform);
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          public void StopTimer() {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              m_TimerRunning = false;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">         */</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">GameSystem</span><span style="color:#111">.</span><span style="color:#111">Instance</span><span style="color:#111">.</span><span style="color:#111">StopTimer</span><span style="color:#111">();</span> <span style="color:#75715e">// 暂停</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e">/*
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          public void FinishRun()
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          {
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              BGMPlayer.clip = EndGameSound;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              BGMPlayer.loop = false;
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              BGMPlayer.Play(); // 播放一次结束音频
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              Controller.Instance.DisplayCursor(true); // 显示鼠标
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              Controller.Instance.CanPause = false; // 不能暂停
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">              FinalScoreUI.Instance.Display(); // 显示结束界面
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">          }
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">         */</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">GameSystem</span><span style="color:#111">.</span><span style="color:#111">Instance</span><span style="color:#111">.</span><span style="color:#111">FinishRun</span><span style="color:#111">();</span> <span style="color:#75715e">// 显示结束界面</span>
</span></span><span style="display:flex;"><span>        <span style="color:#111">Destroy</span><span style="color:#111">(</span><span style="color:#111">gameObject</span><span style="color:#111">);</span> <span style="color:#75715e">// 自毁</span>
</span></span><span style="display:flex;"><span>    <span style="color:#111">}</span>
</span></span><span style="display:flex;"><span><span style="color:#111">}</span>
</span></span></code></pre></div><h2 id="编译打包">编译打包</h2>
<p>菜单栏 -&gt; File -&gt; Build Settings 。选择平台，如 Windows ，再点击 Build 即可。完后执行 exe 文件就可以运行</p>


    


                    
                    <div class="row"></div> 

                </div>

            </div> 

        </div> 
<script src="/lib/jquery.min.js"></script> 
<script src="/lib/popper.min.js"></script> 

<script src="/js/bootstrap.min.js"></script> 


<script type="text/javascript" src="/plugins/lunr.min.js"></script>
<script type="text/javascript" src="/plugins/auto-complete.js"></script>
<link href="/plugins/auto-complete.css" rel="stylesheet">
<script type="text/javascript">
  
      var baseurl = "\/";
  
</script>
<script type="text/javascript" src="/plugins/search.js"></script>

<script type="text/javascript" src="/plugins/favorites.js"></script>


<script type="text/javascript" src="/plugins/clipboard.js"></script>
<script>
  new ClipboardJS('.btn');
</script>
</body>
</html>
